package com.example.springbootEncrypt.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author lxiaol
 * @date 2021年12月23日 11:25
 */
@Data
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class PlainResult<T> {

    @ApiModelProperty(value = "返回结果描述")
    private String message = "执行成功";

    @ApiModelProperty(value = "状态码")
    private String code = "000000";

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date timestamp = new Date();

    @ApiModelProperty(value = "返回结果对象")
    private T data;

    public PlainResult(T data) {
        this.data = data;
    }

}
